package com.fatdetection.demo.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

/**
 * <p>swagger配置</p>
 *
 * @author chenjl
 * @date 2021-02-24 16:29:48
 */
@Configuration
public class SwaggerConfiguration {

    @Bean
    public Docket defaultDocket() {

        return new Docket(DocumentationType.SWAGGER_2)
                .groupName(Docket.DEFAULT_GROUP_NAME)
                .enable(true)
                .apiInfo(apiInfo())
                .select()
                .apis(RequestHandlerSelectors.any())
                .build();
    }

    private ApiInfo apiInfo() {
        return new ApiInfoBuilder()
                .title("脂肪-测试项目-后端接口")
                .description("脂肪测试项目后端API接口文档")
                .version("1.0.0")
                .build();
    }
}
